#include <iostream>

// 基类
class Animal {
public:
    virtual void makeSound() const {
        std::cout << "Some generic animal sound" << std::endl;
    }
};

// 派生类
class Dog : public Animal {
public:
    void makeSound() const override {
        std::cout << "Bark" << std::endl;
    }
};

class Cat : public Animal {
public:
    void makeSound() const override {
        std::cout << "Meow" << std::endl;
    }
};

int main() {
    Animal* myAnimal = new Animal();
    Animal* myDog = new Dog();
    Animal* myCat = new Cat();

   
    myAnimal->makeSound(); // 输出: Some generic animal sound
    myDog->makeSound();    // 输出: Bark
    myCat->makeSound();    // 输出: Meow

    delete myAnimal;
    delete myDog;
    delete myCat;

    return 0;
}